package com.atguigu07.encapsulation.exer3;

import java.util.Scanner;

/**
 * ClassName: EmployeeTest
 * Package: com.atguigu07.encapsulation.exer3
 * Description:     在测试类的main中创建员工数组，并从键盘输入员工对象信息，最后遍历输出
 *
 * @Author BuTang
 * @Create 2023/3/1 10:40
 * @Version 1.0
 */
public class EmployeeTest {
    public static void main(String[] args) {
        Scanner scan =new Scanner(System.in);
        Employee[] emp =new Employee[2];
        for (int i = 0; i < 2; i++) {
            emp[i] = new Employee();
            //设置
            System.out.print("姓名");
            emp[i].setName(scan.next());
            System.out.print("性别");
            emp[i].setGender(scan.next().charAt(0));
            System.out.print("年龄");
            emp[i].setAge(scan.nextInt());
            System.out.println("电话");
            emp[i].setTel(scan.next());
        }

            //输出
        System.out.println("--------员工信息--------");
        for (int i = 0; i < 2; i++) {

            System.out.println(i+1+"\t"+emp[i].getInfo());
        }
        System.out.println("------员工信息结束--------");



    }


}
